package com.zbkj.service.sfexpress;

import com.zbkj.service.sfexpress.order.CreateOrderMsgData;
import com.zbkj.service.sfexpress.order.ExpReceUpdateOrder;
import com.zbkj.service.sfexpress.pickup.CheckPickupTimeMsgData;
import com.zbkj.service.sfexpress.print.PrintWayBillsMsgData;
import com.zbkj.service.sfexpress.response.SFResult;
import com.zbkj.service.sfexpress.util.ExpressServiceCodeEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "SF-Express", url = "${express.sf.call-url}", configuration = SFFeignAuthConfiguration.class)
public interface SFExpressClient {

    /**
     * 创建订单
     *
     * @param msgData 请求数据
     * @return 响应数据
     */
    @PostMapping(value = "/std/service")
    @SFServiceCode(ExpressServiceCodeEnum.EXP_RECE_CREATE_ORDER)
    SFResult<String> expReceCreateOrder(@RequestBody CreateOrderMsgData msgData);

    /**
     * 确认 / 取消订单
     * @param msgData
     * @return
     */
    @PostMapping(value = "/std/service")
    @SFServiceCode(ExpressServiceCodeEnum.EXP_RECE_UPDATE_ORDER)
    SFResult<String> expReceUpdateOrder(@RequestBody ExpReceUpdateOrder msgData);

    /**
     * 检测揽件时间是否可用
     *
     * @param msgData 请求数据
     * @return 响应
     */
    @PostMapping(value = "/std/service")
    @SFServiceCode(ExpressServiceCodeEnum.COM_RECE_CLOUD_PRINT_WAYBILLS)
    SFResult<String> printWayBills(@RequestBody PrintWayBillsMsgData msgData);

    /**
     * 检测揽件时间是否可用
     *
     * @param msgData 请求数据
     * @return 响应
     */
    @PostMapping(value = "/std/service")
    @SFServiceCode(ExpressServiceCodeEnum.EXP_EXCE_CHECK_PICKUP_TIME)
    SFResult<String> checkPickupTime(@RequestBody CheckPickupTimeMsgData msgData);

}
